{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-system.tpl"}</nav>
    <article class="right-col">
		<h2>Thiết lập biến</h2>
        <form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}setting/save" class="ui"> 
            <ul>
                {foreach item=item key=i from=$variable}
                    {if $i == "BAOKIM" || $i == "PERFECT_MONEY" || $i == "WEB_MONEY" || $i == "NGANLUONG"}
                        <li>
                            <h3>{$item.NAME.label}</h3>
                            <input type="hidden" name="variable[{$i}][NAME][label]" value="{$item.NAME.label|escape}" />
                        </li>
                        {foreach item=sitem key=si from=$item}
                            {if $si != "NAME"}
                                <li>
                                    <input type="hidden" name="variable[{$i}][{$si}][tag]" value="{$sitem.tag|escape}" />
                                    <input type="hidden" name="variable[{$i}][{$si}][label]" value="{$sitem.label|escape}" />
                                    <label for="{$i}{$si}">{$sitem.label}</label>
                                    {if $sitem.tag == "input"}
                                        <div class="txt">
                                            <input type="text" name="variable[{$i}][{$si}][val]" id="{$i}{$si}" maxlength="255" value="{$sitem.val|escape}" />
                                        </div>
                                    {elseif $sitem.tag == "textarea"}
                                        <div class="area">
                                            <textarea rows="1" cols="1" name="variable[{$i}][{$si}][val]" id="{$i}{$si}">{$sitem.val}</textarea>
                                        </div>
                                    {/if}
                                    {if $sitem.hint}
                                    	<input type="hidden" name="variable[{$i}][{$si}][hint]" value="{$sitem.hint|escape}" />
                                        <p style="float:left;margin-left:200px;clear:both;color:#CCC;margin-top:5px;">{$sitem.hint}</p>
                                    {/if}
                                </li>
                            {/if}
                        {/foreach}                        
                    {else}
                        <li>
                            <input type="hidden" name="variable[{$i}][tag]" value="{$item.tag|escape}" />
                            <input type="hidden" name="variable[{$i}][label]" value="{$item.label|escape}" />
                            <label for="{$i}">{$item.label}:</label>
                            {if $item.tag == "input"}                        	
                                <div class="txt">
                                    
                                    <input type="text" name="variable[{$i}][val]" id="{$i}" maxlength="255" value="{$item.val|escape}" />
                                </div>
                            {elseif $item.tag == "textarea"}                        	
                                <div class="area">
                                    <textarea rows="1" cols="1" name="variable[{$i}][val]" id="{$i}">{$item.val}</textarea>
                                </div>
                            {/if}
                            {if $item.hint}
                            	<input type="hidden" name="variable[{$i}][hint]" value="{$item.hint|escape}" />
                            	<p style="float:left;margin-left:200px;clear:both;color:#CCC;margin-top:5px;">{$item.hint}</p>
                            {/if}
                        </li>
                    {/if}                
                {/foreach}
                <li>
                    <button type="submit"><strong>Lưu dữ liệu</strong></button>
                    <button type="reset"><strong>Nhập lại</strong></button>
                </li>
            </ul>
        </form>
	</article>
</section>
{include file="common/footer.tpl"}